﻿using GatewayServerService.Data;
using Microsoft.AspNetCore.Http;
using Models.Common;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using UtilsORM;
using UtilsORM.MySqlData;
////using System.Web.Script.Serialization;

namespace GatewayServerService.Data
{
    public class DBIotProductState
    {



        /// <summary>
        /// 写入mq日志
        /// </summary>
        /// <param name="mQReqModel"></param>
        /// <param name="msg"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public iot_product_state getProductStateModel(string dguid)
        {
            //判断产品是否自动运行
            EFYihongIotContext ef = new EFYihongIotContext();
            iot_device device = new DBIotDeviceCache().getClientDeviceByCache(dguid);
            return ef.iot_product_state.Where(c => c.ps_p_guid == device.d_p_guid).FirstOrDefault();
        }
    }
}
